<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/work_today.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client_tracking.css"/>
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script src="${staticServer}/inc/js/tips.js"></script>
<script src="${staticServer}/inc/js/model_resp.js"></script>
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css"/>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script>
$(function(){
	$("#nickname").val(${nickname});
})
	var contextPath='${contextPath}';
        var selectMsg = function(){
            var stu_name = $("#nickname").val();
            window.location.href=encodeURI("${contextPath}/index/tuijianList.htm?stu_name="+stu_name);
        }
        
     var save = function(){
            window.location.href=encodeURI("${contextPath}/index/tuijian_student_add.htm");
        }
     
     var deletetuijian = function () {
         var $obj = $("input[type=checkbox]:checked");
         if ($obj.length == 0) {
             infopad.err("请至少选择一条记录");
             return;
         }
         if (confirm("确定删除？删除后无法恢复。")) {
             var ids = '';
             for (var i = 0; i < $obj.length; i++) {
                 if (i == $obj.length - 1) {
                     ids += $($obj[i]).val();
                 } else {
                     ids += $($obj[i]).val() + ",";
                 }
             }
             var url = contextPath + "/index/deletetuijian.json";
             $.post(url, {"id": ids},
                 function (ms) {
                     if (ms.msg != null) {
                         if (ms.msg == "1") {
                             infopad.msg("删除成功!");
                             setTimeout(function () {
                            		window.location.href="${contextPath}/index/tuijianList.htm";
                             }, 1200);
                         }else{
                             infopad.err("不可删除!");
                         }
                     } else {
                         infopad.err("抱歉，系统忙");
                     }
             });
         };
     }
</script>
</head>

<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>咨询师业务管理</li>
			<li>&gt;</li>
			<li class="current">推荐学员列表</li>
		</ul>
	</div>
	<div id="container">
		<div id="title"></div>
		<table class="form_table">
			<tr>
				<td><label><b>查询条件：姓名</b></label>
				<input type="text" name="nickname" id="nickname" size="25" value="" />
				<input type="button" value=" 查 询 " onclick="selectMsg()" />
				<input type="button" value=" 添 加 " onclick="save()" />
				<input title="清理自己填写或上传的错误数据" type="button" value=" 删除 " onclick="deletetuijian()" /></td>
			</tr>
		</table>
		<table>
			<tr class="fields">
				<th></th>
				<th>中心</th>
				<th width="10%">推荐类别</th>
				<th>推荐学员</th>
				<th>被推荐学员</th>
				<th>参与推荐老师</th>
				<th>推荐日期</th>
				<th>审核状态</th>
				<th width="15%">赠送课时情况</th>
				<th width="12%">操作</th>
			</tr>
			<#if list??>
        		<#list list as list>
            	<tr class="even_row">
            	<td align="center"><input name="" style="width:16px;height:16px;"  type="checkbox" value="<#if list.id??>${list.id}</#if>"></td>
                <td align="center" class="stress"><#if list.center??>${list.center}</#if></td>
                <td align="center" class="stress"><#if list.tuijian_type??>${list.tuijian_type}</#if></td>
                <td align="center" rel="nohover"><#if list.stu_name?? && list.stu_name!='null'>${list.stu_name}</#if></td>
                <td align="center" rel="nohover"><#if list.tuijian_name??  && list.tuijian_name!='null'>${list.tuijian_name}</#if></td>
                <td align="center"><#if list.cy_tuijian_teacher?? && list.cy_tuijian_teacher!='null'>${list.cy_tuijian_teacher}</#if></td>
                <td align="center"><#if list.tjstu_time2??>${list.tjstu_time2}</#if></td>
                <td align="center"><#if list.xz_state??><#if list.xz_state?exists><#if list.xz_state=='2'>通过</#if><#if list.xz_state=='1'>不通过</#if><#if list.xz_state=='0'>未审核</#if></#if></#if></td>
                <td align="center">赠送<#if list.tuijian_kes??>${list.tuijian_kes}</#if>次。</td>
                <td>
                	<#if list.cp_center??&&list.cp_center!="null"><a href="#" class="tosnmiddle_btn xun">已测评</a><#else><a href="${contextPath}/index/tuijiandetail.htm?id=${list.id}" class="tosnmiddle_btn xun">编辑明细</a></#if>
					--
					<a href="${contextPath}/index/tuijiansh.htm?id=${list.id}" class="tosnmiddle_btn xun">成单审核</a>
				</td>
            	</tr>
        	</#list>
    		</#if>
			</table>
	</div>
	<div id="pager" style="width: 820px;">
	<ul id="pagination">
		<#if page??>
		<#if page.pagetotal?? && page.pagetotal!="0">
	<#assign pagetotal = page.pagetotal>
	<#else>
	<#assign pagetotal = 1>
	</#if>
			<#if page.currpage??>
	<#assign currpage = page.currpage>
	<#else>
	<#assign currpage = 1>
	</#if>
		<#if currpage==1 >
			<li class="previous-off">上一页</li>
		<#else>
			<li class="previous"><a href="${contextPath}/index/tuijianList.htm?currPage=${currpage-1}">上一页</a></li>
		</#if>
					
		<#if pagetotal<=11>
			<#list 1..pagetotal as index_up>  
	           <#if currpage==index_up > 
	           		<li class="current">${index_up}</li>
	           <#else>
	           		<li><a href="${contextPath}/index/tuijianList.htm?currPage=${index_up}">${index_up}</a></li>  
	           </#if>  
			</#list>  
		<#else>
			<#if currpage<=8 >
				<#list 1..9 as index_up>  
	           	<#if currpage==index_up >  
	            	<li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/tuijianList.htm?currPage=${index_up}">${index_up}</a></li> 
	           	</#if>
	           	</#list>  
	           	<li>...</li>
	           	<li><a href="${contextPath}/index/tuijianList.htm?currPage=${pagetotal}">${pagetotal}</a></li>  
				
			<#elseif (currpage>= 9 && currpage<pagetotal-7)  >	
				<li><a href="${contextPath}/index/tuijianList.htm?currPage=1">1</a></li>  
				<li>...</li>
				<#list currpage-3..currpage+3 as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/tuijianList.htm?currPage=${index_up}">${index_up}</a></li>  
	           	</#if>
	           	</#list>
				<li>...</li>
	           	<li><a href="${contextPath}/index/tuijianList.htm?currPage=${pagetotal}">${pagetotal}</a></li>   
			<#else>
				<li><a href="${contextPath}/index/tuijianList.htm?currPage=1">1</a></li> 
				<li>...</li>
				<#list pagetotal-8..pagetotal as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/tuijianList.htm?currPage=${index_up}">${index_up}</a></li> 
	           	</#if>
				</#list>  
			</#if>
			
		</#if> 
		<#if currpage==pagetotal >
		 	<li class="previous-off">下一页</li>
		<#else>
			<li class="previous"><a href="${contextPath}/index/tuijianList.htm?currPage=${currpage+1}">下一页</a></li>
		</#if>
		<li class="pageinfo">共${page.total}条记录</li>
	</#if>
	</ul></div>
	<div class="emptyline"></div>
</body>
</html>